//package com.tuyou.cloud.feign.controller;
//
//import com.tuyou.cloud.feign.service.DefaultFeignService;
//import com.tuyou.cloud.feign.service.HelloService;
//import feign.Client;
//import feign.Contract;
//import feign.Feign;
//import feign.codec.Decoder;
//import feign.codec.Encoder;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.cloud.netflix.feign.FeignClientsConfiguration;
//import org.springframework.context.annotation.Import;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RequestMethod;
//import org.springframework.web.bind.annotation.RestController;
//
///**
// * 手动创建feign
// */
//@Import(FeignClientsConfiguration.class)
//@RestController
//@RequestMapping("/custom")
//public class CustomFeignController {
//
//    HelloService helloService;
//
//    @Autowired
//    public CustomFeignController(Client client, Decoder decoder, Encoder encoder, Contract contract) {
//        helloService = Feign.builder().client(client)
//                .decoder(decoder)
//                .encoder(encoder)
//                .contract(contract)
//                .target(HelloService.class, "http://hello-service/");
//    }
//
//    @RequestMapping(value = "/feign-consumer", method = RequestMethod.GET)
//    public String helloConsumer() throws InterruptedException {
//        return helloService.hello();
//    }
//}
